Skip to content

Conversation

@uglide
Copy link
Contributor

@uglide uglide commented Nov 6, 2025

Refined version of #4201

  • This PR introduces three new Redis client classes (RedisClient, RedisClusterClient, RedisSentinelClient) that provide a clean, developer-friendly API while addressing critical developer experience issues identified in the current Jedis architecture.
  • Old classes and public constructors of UnifiedJedis are marked as deprecated.

Deprecated Class Mappings

Deprecated Class Replacement Description
JedisPool RedisClient Pooled connection client for standalone Redis
JedisSentinelPool RedisSentinelClient Pooled connection client for Redis Sentinel
JedisPooled RedisClient Pooled connection client for standalone Redis
JedisSentineled RedisSentinelClient Client for Redis Sentinel deployments
JedisCluster RedisClusterClient Client for Redis Cluster deployments
JedisPoolConfig ConnectionPoolConfig Configuration class for connection pooling
JedisFactory (internal) Factory for pooled Jedis instances (no direct replacement needed)
UnifiedJedis (constructors) RedisClient / RedisSentinelClient / RedisClusterClient Use specific client classes instead of base class

@uglide uglide requested review from a-TODO-rov, atakavci, Copilot and ggivo and removed request for Copilot November 6, 2025 17:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new, cleaner client API for Jedis by creating three new client classes (RedisClient, RedisClusterClient, and RedisSentinelClient) that replace the legacy client classes (JedisPooled, JedisCluster, and JedisSentineled). The new classes use a builder pattern for advanced configuration while maintaining simple constructors for basic use cases.

  • Introduced new client classes with builder pattern support for flexible configuration
  • Deprecated legacy client classes and UnifiedJedis constructors with migration guidance
  • Updated internal references to use the new RedisClusterClient.INIT_NO_ERROR_PROPERTY constant
  • Added comprehensive integration tests demonstrating migration paths from legacy constructors

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
RedisClient.java New standalone Redis client with simple constructors and builder pattern support
RedisClusterClient.java New Redis Cluster client replacing JedisCluster with builder pattern
RedisSentinelClient.java New Redis Sentinel client replacing JedisSentineled
JedisPooled.java Added deprecation notice directing users to RedisClient
JedisCluster.java Added deprecation notice directing users to RedisClusterClient
JedisSentineled.java Added deprecation notice directing users to RedisSentinelClient
UnifiedJedis.java Deprecated multiple constructors and removed unused import
ClusterClientBuilder.java Removed generic type constraint to support both legacy and new cluster clients
ClusterConnectionProvider.java Updated INIT_NO_ERROR_PROPERTY reference to use RedisClusterClient
JedisClusterInfoCache.java Updated INIT_NO_ERROR_PROPERTY reference to use RedisClusterClient
RedisClusterClientMigrationIntegrationTest.java Comprehensive integration tests validating migration from JedisCluster to RedisClusterClient

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@uglide uglide force-pushed the im/introduce-new-client-classes branch 2 times, most recently from bf56e75 to be9dc0e Compare November 19, 2025 18:04
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

Test Results

   282 files  +1     282 suites  +1   11m 44s ⏱️ -9s
10 365 tests +7  10 158 ✅  - 146  207 💤 +153  0 ❌ ±0 
 2 727 runs  +7   2 727 ✅ +  7    0 💤 ±  0  0 ❌ ±0 

Results for commit 066e34c. ± Comparison against base commit fa52d66.

This pull request removes 1438 and adds 1445 tests. Note that renamed tests count towards both.
redis.clients.jedis.JedisClusterTest ‑ clusterLinks2
redis.clients.jedis.JedisClusterTest ‑ clusterPeriodTopologyRefreshTest
redis.clients.jedis.JedisClusterTest ‑ clusterRefreshNodes
redis.clients.jedis.JedisClusterTest ‑ testAskResponse
redis.clients.jedis.JedisClusterTest ‑ testAskResponseWithConfig
redis.clients.jedis.JedisClusterTest ‑ testCalculateConnectionPerSlot
redis.clients.jedis.JedisClusterTest ‑ testCloseable
redis.clients.jedis.JedisClusterTest ‑ testCloseableWithConfig
redis.clients.jedis.JedisClusterTest ‑ testClusterCountKeysInSlot
redis.clients.jedis.JedisClusterTest ‑ testClusterFlushSlots
…
redis.clients.jedis.RedisClientTest ‑ allowUrlWithNoDBAndNoPassword
redis.clients.jedis.RedisClientTest ‑ checkCloseableConnections
redis.clients.jedis.RedisClientTest ‑ checkPoolOverflow
redis.clients.jedis.RedisClientTest ‑ checkResourceWithConfig
redis.clients.jedis.RedisClientTest ‑ closeBrokenResourceTwice
redis.clients.jedis.RedisClientTest ‑ closeResourceTwice
redis.clients.jedis.RedisClientTest ‑ customClientName
redis.clients.jedis.RedisClientTest ‑ getNumActiveReturnsTheCorrectNumber
redis.clients.jedis.RedisClientTest ‑ getNumActiveWhenPoolIsClosed
redis.clients.jedis.RedisClientTest ‑ invalidClientName
…
This pull request removes 9 skipped tests and adds 54 skipped tests. Note that renamed tests count towards both.
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[1] ‑ restoreParams
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[2] ‑ restoreParams
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[3] ‑ encodeCompleteResponseHgetall
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[3] ‑ encodeCompleteResponseXinfoStream
redis.clients.jedis.commands.unified.pooled.PooledAllKindOfValuesCommandsTest[3] ‑ restoreParams
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[1] ‑ restoreParams
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseHgetallResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[2] ‑ encodeCompleteResponseXinfoStreamResp3
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[2] ‑ restoreParams
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[3] ‑ encodeCompleteResponseHgetall
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[3] ‑ encodeCompleteResponseXinfoStream
redis.clients.jedis.commands.unified.client.RedisClientAllKindOfValuesCommandsTest[3] ‑ restoreParams
redis.clients.jedis.commands.unified.client.RedisClientBinaryValuesCommandsTest[1] ‑ msetexNx_binary_parametrized(String, MSetExParams)[1]
…
This pull request skips 108 tests.
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[1] ‑ testMsetexNx_parametrized(String, MSetExParams)[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[1] ‑ testMsetexNx_parametrized(String, MSetExParams)[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[1] ‑ testMsetexNx_parametrized(String, MSetExParams)[3]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[1] ‑ testMsetexNx_parametrized(String, MSetExParams)[4]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[1] ‑ testMsetexNx_parametrized(String, MSetExParams)[5]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[2] ‑ testMsetexNx_parametrized(String, MSetExParams)[1]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[2] ‑ testMsetexNx_parametrized(String, MSetExParams)[2]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[2] ‑ testMsetexNx_parametrized(String, MSetExParams)[3]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[2] ‑ testMsetexNx_parametrized(String, MSetExParams)[4]
redis.clients.jedis.commands.commandobjects.CommandObjectsStringCommandsTest[2] ‑ testMsetexNx_parametrized(String, MSetExParams)[5]
…

♻️ This comment has been updated with latest results.

@uglide uglide force-pushed the im/introduce-new-client-classes branch from d401cac to 066e34c Compare November 20, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants